import config from "@/config"
import http from "@/utils/request"

export default {
    list: {
        url: `${config.API_URL}/user/list-page`,
        name: "获取用户列表",
        get: async function (params) {
            return await http.get(this.url, params);
        }
    },
    listByName: {
        url: `${config.API_URL}/user/list-name`,
        name: "获取列表",
        get: async function (params) {
            return await http.get(this.url, params);
        }
    },
    action: {
        url: `${config.API_URL}/user`,
        name: "用户操作",
        get: async function (params) {
            return await http.get(this.url, params);
        },
        post: async function (params) {
            return await http.post(this.url, params);
        },
        put: async function (params) {
            return await http.put(this.url, params);
        },
    },
    updateStatus: {
        url: `${config.API_URL}/user/status`,
        name: "用户状态更新",
        put: async function (params) {
            return await http.put(this.url, params);
        },
    },
    grade: {
        all: {
            url: `${config.API_URL}/grade/all`,
            name: "获取全部",
            get: async function (params) {
                return await http.get(this.url, params);
            },
        }
    },
    course: {
        list: {
            url: `${config.API_URL}/user-course/list-page`,
            name: "获取列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        all: {
            url: `${config.API_URL}/user-course/all`,
            name: "获取所有列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        action: {
            url: `${config.API_URL}/user-course`,
            name: "用户操作",
            post: async function (params) {
                return await http.post(this.url, params);
            }
        },
        addBatch: {
            url: `${config.API_URL}/user-course/batch`,
            name: "批量新增",
            post: async function (params) {
                return await http.post(this.url, params);
            }
        },
        updateStatus: {
            url: `${config.API_URL}/user-course/status`,
            name: "更新状态",
            put: async function (params) {
                return await http.put(this.url, params);
            }
        }
    }

}